﻿@{
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
    ViewBag.Title = "网非e学院--我的账户";
    var userExpenseList = ViewBag.UserExpenseList as List<XZL.Web.Da.Proc_AccountLog_UserExpenseResult>;
    var promoteExpenseList = ViewBag.PromoteExpenseList as List<XZL.Web.Da.Proc_AccountLog_PromoteExpenseResult>;
    var teamExpenseList = ViewBag.TeamExpenseList as List<XZL.Web.Da.Proc_AccountLog_TeamExpenseResult>;
}

<div class="ci_Title">
    <span class="hp_TypeNav">我的账户</span>
</div>
<div class="ms_Month">
    <select class="customText" id="textYear">
        <option>2016</option>
    </select><b>&nbsp;年&nbsp;&nbsp;</b>
    <select class="customText" id="textMonth">
        <option>1</option>
        <option>2</option>
        <option>3</option>
        <option>4</option>
        <option>5</option>
        <option>6</option>
        <option>7</option>
        <option>8</option>
        <option>9</option>
        <option>10</option>
        <option>11</option>
        <option>12</option>
    </select><b>&nbsp;月</b>
</div>
<div class="ms_MyAcc">
    本月个人消费：<b class="ms_MyAccNum">@ViewBag.UserExpense</b><br />
    本月推广消费：<b class="ms_MyAccNum">@ViewBag.PromoteExpense</b><br />
    小组推广消费：<b class="ms_MyAccNum">@ViewBag.TeamExpense</b><br />
    您目前的余额：<b class="ms_MyAccNum">@ViewBag.MyScore</b>
</div>
<div class="ci_Title" id="ci_Title">
    <span class="hp_TypeNav  hp_TypeNavSel">个人消费</span>&nbsp;&nbsp;<b style="color:black">|</b>&nbsp;
    <span class="hp_TypeNav">个人推广(@ViewBag.PromoteUser<span>人</span>)</span>&nbsp;&nbsp;<b style="color:black">|</b>&nbsp;
    <span class="hp_TypeNav">小组推广(@ViewBag.TeamUser<span>人</span>)</span>
</div>
<div class="accountList">
    <div class="ms_MyAccList">
        <div class="ms_MyAccItem" style="background-color:#f2f2f2;color:#333">
            <span class="ms_MyAccItemName">用户</span>
            <span class="ms_MyAccItemAmount">消费金额</span>
            <span class="ms_MyAccItemTime">日期</span>
        </div>
        @foreach (var item in userExpenseList)
        {
            <div class="ms_MyAccItem">
                <span class="ms_MyAccItemName">@item.WeiXinName</span>
                <span class="ms_MyAccItemAmount">￥@item.Amount </span>
                <span class="ms_MyAccItemTime">@Convert.ToDateTime(item.CreateTime).ToString("MM-dd")</span>
            </div>
        }
    </div>
</div>
<div class="accountList" style="display:none">
    <div class="ms_MyAccList">
        <div class="ms_MyAccItem" style="background-color:#f2f2f2;color:#333">
            <span class="ms_MyAccItemName">用户</span>
            <span class="ms_MyAccItemAmount">消费金额</span>
            <span class="ms_MyAccItemTime">日期</span>
        </div>
        @foreach (var item in promoteExpenseList)
        {
            <div class="ms_MyAccItem">
                <span class="ms_MyAccItemName">@item.WeiXinName</span>
                <span class="ms_MyAccItemAmount">￥@item.Amount </span>
                <span class="ms_MyAccItemTime">@Convert.ToDateTime(item.CreateTime).ToString("MM-dd")</span>
            </div>
        }
    </div>
</div>
<div class="accountList" style="display:none">
    <div class="ms_MyAccList">
        <div class="ms_MyAccItem" style="background-color:#f2f2f2;color:#333">
            <span class="ms_MyAccItemName">用户</span>
            <span class="ms_MyAccItemAmount">消费金额</span>
            <span class="ms_MyAccItemTime">日期</span>
        </div>
        @foreach (var item in teamExpenseList)
        {
            <div class="ms_MyAccItem">
                <span class="ms_MyAccItemName">@item.WeiXinName</span>
                <span class="ms_MyAccItemAmount">￥@item.Amount </span>
                <span class="ms_MyAccItemTime">@Convert.ToDateTime(item.CreateTime).ToString("MM-dd")</span>
            </div>
        }
    </div>
</div>
<script>
    //导航切换
    $("#ci_Title .hp_TypeNav").click(function () {
        var num = $("#ci_Title  .hp_TypeNav").size();
        var ind = $("#ci_Title .hp_TypeNav").index(this);
        $("#ci_Title  .hp_TypeNav").removeClass("hp_TypeNavSel");
        $("#ci_Title  .hp_TypeNav").eq(ind).addClass("hp_TypeNavSel");
        $(".accountList").hide();
        $(".accountList").eq(ind).show();
    })
    //底部导航选中
    $("#ImgWode").attr("src", "../../Image/logoWodeSel.png");

    //日期
    var mydate = new Date();
    var str = mydate.getFullYear();
    if (str > 2016) {
        for (i = 2017; i <= str; i++) {
            $("#textYear").append("<option>"+i+"</option>");
        }
    }

    $("#textYear").val("@ViewBag.Year");
    $("#textMonth").val("@ViewBag.Month");

    $("#textYear").change(function () {
        DateChange();
    })
    $("#textMonth").change(function () {
        DateChange();
    })
    function DateChange() {
        var date = $("#textYear").val() + "-" + $("#textMonth").val();
        window.location.href = "MyAccount?Date=" + date;
    }
</script>
